<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="https://fastly.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.38/favicon.ico">
    <link rel="canonical" href="https://getbootstrap.com/docs/3.4/examples/navbar-static-top/">

    <title>Static Top Navbar Example for Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link href="./css/bootstrap.css" rel="stylesheet">

    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <link href="https://fastly.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.38/assets/css/ie10-viewport-bug-workaround.css"
          rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="https://fastly.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.38/examples/navbar-static-top/navbar-static-top.css"
          rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]>
    <script src="https://fastly.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.38/assets/js/ie8-responsive-file-warning.js"></script>
    <![endif]-->
    <script src="https://fastly.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.38/assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>

<!-- Static navbar -->
<nav class="navbar navbar-default navbar-static-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                    aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">看板</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <li class="active"><a href="#">首页</a></li>
                <li><a href="#">关于</a></li>
                <li><a href="#">联系我们</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false">工作流 <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">待办故事</a></li>
                        <li><a href="#">迭代任务</a></li>
                        <li><a href="#">后端开发</a></li>
                        <li role="separator" class="divider"></li>
                        <li class="dropdown-header">前端开发</li>
                        <li><a href="#">软件测试</a></li>
                        <li><a href="#">运行维护</a></li>
                    </ul>
                </li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <li><a href="../navbar/">默认</a></li>
                <li class="active"><a href="./">静止 <span class="sr-only">(current)</span></a></li>
                <li><a href="../navbar-fixed-top/">固定</a></li>
            </ul>
        </div><!--/.nav-collapse -->
    </div>
</nav>


<div class="container-fluid" id="app">
    <div class="row">
        <div class="col-md-4">
            <div class="panel panel-success">
                <!-- Default panel contents -->
                <div class="panel-heading">功能操作区</div>
                <div class="panel-body">
                    <div class="list-group">
                        <a href="/sub/flow/flow.html" class="list-group-item active">
                            工作流管理
                        </a>
                        <a href="/sub/story/story.html" class="list-group-item">故事管理</a>
                        <a href="/sub/task/task.html" class="list-group-item">任务管理</a>
                        <a href="/sub/user/user.html" class="list-group-item">用户管理</a>
                        <a href="/sub/kanban/kanban.html" class="list-group-item">看板墙</a>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-8">
            <div class="panel panel-default">
                <!-- Default panel contents -->
                <div class="panel-heading">内容显示区</div>
                <div class="panel-body">
                    <a href="/user/save" class="btn btn-lg btn-primary">添加</a>
                    <table class="table table-bordered table-hover table-striped">
                        <tr>
                            <th>主键</th>
                            <th>姓名</th>
                            <th>性别</th>
                            <th>密码</th>
                            <th>邮箱</th>
                            <th>操作</th>
                        </tr>
                        <tr v-for="(u,index) in users" :key="u.id">
                            <td>{{u.id}}</td>
                            <td>{{u.name}}</td>
                            <td>{{u.sex}}</td>
                            <td>{{u.pwd}}</td>
                            <td>{{u.email}}</td>
                            <td>
                                <a :href="'/delete/'+u.id" class="btn btn-danger">删除</a>
                                <button class="btn btn-warning btn-sm" @click="deleteUserById(u.id,index)">删除</button>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
                <!-- Main component for a primary marketing message or call to action -->
                <div class="jumbotron">
                    <h1>看板系统</h1>
                    <p>This example is a quick exercise to illustrate how the default, static and fixed to top navbar work. It
                        includes the responsive CSS and HTML, so it also adapts to your viewport and device.</p>
                    <p>To see the difference between static and fixed top navbars, just scroll.</p>
                    <p>
                        <a class="btn btn-lg btn-primary" href="../../components/#navbar" role="button">View navbar docs  &raquo;</a>
                    </p>
                    <address>
                        版权所有，违者必究
                    </address>
                </div>
        </div>
    </div>
</div> <!-- /container -->


<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="./js/jquery-1.12.4.min.js"
        integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ"
        crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="https://fastly.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.38/assets/js/vendor/jquery.min.js"><\/script>')</script>
<script src="./js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="https://fastly.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.38/assets/js/ie10-viewport-bug-workaround.js"></script>
<script src="./js/vue.js"></script>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            users: []
        },
        methods: {
            loadAllUser: function () {
                var self = this;
                $.getJSON("/user/all", function (r) {
                    console.log(r);
                    self.users = r;
                })
            },
            deleteUserById: function (id, index) {
                var self = this;
                $.getJSON("/user/delete/" + id, function (r) {
                    self.users.splice(index, 1);
                })
            },
            login:function () {
                $.ajax({
                    url:'/user/login',//网址接口
                    type:'POST', //提交的方式类型 GET,POST
                    data: JSON.stringify({username:"CS",password:"123"}), //转换为JSON
                    contentType:'application/json;charset=utf-8',
                    dataType:'json',
                    success:(r) => {
                        console.log(r);
                    },
                    error:()=>{
                        alert('提交请求失败');
                    }
                })
            }
        }
    })
    app.loadAllUser();
    app.login();
</script>
</body>
</html>
